mui.init();
var user_id = localStorage.getItem("user_id");
/*
 * 点击确认修改密码
 */
mui('body').on('tap', '#modify_login_pwd', function() {
	var old_pwd = $("#old_pwd").val(); //旧密码
	var new_pwd = $("#new_pwd").val(); //新密码
	var again_new_pwd = $("#again_new_pwd").val(); //确认新密码
	if(!old_pwd) {
		mui.alert("请输入旧密码！")
		return false;
	}
	if(!new_pwd) {
		mui.alert("请输入新密码！")
		return false;
	}
	if(!again_new_pwd) {
		mui.alert("请再次输入新密码！")
		return false;
	}
	if(new_pwd != again_new_pwd) {
		mui.alert("两次输入的新密码不符！")
		return false;
	}
	interfRequest.update_pass.data = {
		user_id: user_id, //用户名称
		opassword: old_pwd, //旧密码
		npassword: new_pwd //新密码
	}
	socialRequest(interfRequest.update_pass);
})
/*
 * 点击确认修改密码---方法
 */
function update_passHandle(data) {
	if(data.error_code == 10000) {
		mui.openWindow({
			url: 'my.html',
			id: 'my',
			createNew: true
		});
		mui.toast("修改成功！");
	} else {
		mui.alert(data.msg);
	}
}